import 'package:flutter/services.dart';
import 'package:dk_flutter_base/dk_core.dart';

/*
***********
*日志打印工具类,在原生代码中添加对应channel处理
***********
*/

class LogUtils {

  LogUtils._();
  static const _platform = const MethodChannel('com.danke.flutter.plugins/log');

  static void printLog(String tag, String msg) {
    if(Env.value.type == EnvType.DEBUG) {
      _platform.invokeMethod('printLogMessage', {'tag': tag, 'msg': msg});
    }
  }

  static void printMessage( String msg) {
    if(Env.value.type == EnvType.DEBUG) {
      _platform.invokeMethod('logMessage', {'msg': msg});
    }
  }

}